<head>
    <meta charset="UTF-8">
    <title>打零工企业web</title>
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="./js/datepicker/jquery-ui.css">
    <link rel="stylesheet" href="css/default.css"/>
    <link rel="stylesheet" href="css/common.css"/>
    <link rel="stylesheet" href="js/pagination/paging.css"/>
    <link rel="stylesheet" href="css/linggong.css"/>
</head>
<div class="bread_nav"> <b>客户管理</b> / 我的客户 / 客户详情</div>
<div class="infobox" id="info">
    <img src="images/mifeng.png" alt="">
    <ul>
        <li>打零工互联网科技有限公司 <span> <i class="ren"></i> 未认证</span></li>
        <li>私营企业</li>
        <li>上海市普陀区真北路955号</li>
        <li>注册时间：2017年12月1日</li>
    </ul>
</div>
<div class="infolist">
    <ul>
        <li>发单量<span>17</span></li>
        <li>雇佣人数<span>107</span></li>
        <li>充值金额<span>17</span></li>
        <li>支付金额<span>17</span></li>
    </ul>
</div>
<div class="odd_list" id="odd_list">
    <p>正在使用代理服务的零工</p>
    <div class="odd_list_line">
        <ul>
            <li><b class="odd_name">保洁阿姨</b> <img src="images/icon_5.png" alt=""> <img src="images/icon_8.png" alt="">
                <span>家政保洁</span> <span>计时</span></li>
            <li><b class="redColor">20</b>元 / 小时 需2人 工作时间：10.2-10.4 9:00-18:00</li>
            <li>上海市普陀区真北路958号1号楼7楼</li>
        </ul>
        <div class="dlg-row-3 text-center">
            <div class="dlg-lgsc-list-right">
                进度&nbsp;
                <label class="dlg-box"></label>
                (4/10)
            </div>
        </div>
        <span class="zhuan_odd" onclick="zhuandan()">转单</span>
    </div>
    <div class="odd_list_line">
        <ul>
            <li><b class="odd_name">保洁阿姨</b> <img src="images/icon_5.png" alt=""> <img src="images/icon_8.png" alt="">
                <span>家政保洁</span> <span>计时</span></li>
            <li><b class="redColor">20</b>元 / 小时 需2人 工作时间：10.2-10.4 9:00-18:00</li>
            <li>上海市普陀区真北路958号1号楼7楼</li>
        </ul>
        <div class="dlg-row-3 text-center">
            <div class="dlg-lgsc-list-right">
                进度&nbsp;
                <label class="dlg-box"></label>
                (4/10)
            </div>
        </div>
        <span class="zhuan_odd">转单</span>
    </div>
    <div class="odd_list_line">
        <ul>
            <li><b class="odd_name">保洁阿姨</b> <img src="images/icon_5.png" alt=""> <img src="images/icon_8.png" alt="">
                <span>家政保洁</span> <span>计时</span></li>
            <li><b class="redColor">20</b>元 / 小时 需2人 工作时间：10.2-10.4 9:00-18:00</li>
            <li>上海市普陀区真北路958号1号楼7楼</li>
        </ul>
        <div class="dlg-row-3 text-center">
            <div class="dlg-lgsc-list-right">
                进度&nbsp;
                <label class="dlg-box"></label>
                (4/10)
            </div>
        </div>
        <span class="zhuan_odd">转单</span>
    </div>
    <div class="odd_list_line">
        <ul>
            <li><b class="odd_name">保洁阿姨</b> <img src="images/icon_5.png" alt=""> <img src="images/icon_8.png" alt="">
                <span>家政保洁</span> <span>计时</span></li>
            <li><b class="redColor">20</b>元 / 小时 需2人 工作时间：10.2-10.4 9:00-18:00</li>
            <li>上海市普陀区真北路958号1号楼7楼</li>
        </ul>
        <div class="dlg-row-3 text-center">
            <div class="dlg-lgsc-list-right">
                进度&nbsp;
                <label class="dlg-box"></label>
                (4/10)
            </div>
        </div>
        <span class="zhuan_odd">转单</span>
    </div>
</div>
<div id="pageTool" class="dlg-task-page page-common"></div>
<!--转单-->
<div id="repeatOrder_modal" class="modal_bg_ground">
    <div class="modal_tan" style="width:480px;">
        <span class="close">x</span>
        <div class="dlg-repeatOrder-modal">
            <h3 class="text-center add-padding-15">转单差价设置</h3>
            <div class="title zhuan_title"></div>
            <div class="dlg-repeatOrder-box">
                <div class="dlg-repeatOrder-group">
                    <label>原报酬</label>
                    <div class="old_price">
                        <span class="dlg-red-color price_wage">20</span><span class="danwei">元/小时</span>
                    </div>
                </div>
                <input type="hidden" id="zhuan_id" />
                <div class="dlg-repeatOrder-group">
                    <label>我要赚</label>
                    <div>
                        <div class="own_money">
                            <input type="text" name="own_money" oninput="if(!/^[0-9]+.?[0-9]*$/.test(this.value)){this.value='';}"/>&nbsp;<span>元/小时</span>&nbsp;&nbsp;
                            <input type="text" name="own_money1" oninput="if(!/^[0-9]+.?[0-9]*$/.test(this.value)){this.value='';}"/>&nbsp;<span>元/件</span>
                        </div>
                        <div class="dlg-gray-color">最高差价为报酬的60%</div>
                    </div>
                </div>
                <div class="dlg-repeatOrder-group">
                    <label>转发后报酬</label>
                    <div class="subordinate_money">
                        <input type="text" oninput="if(!/^[0-9]+.?[0-9]*$/.test(this.value)){this.value='';}"/>&nbsp;<span>元/小时</span>&nbsp;&nbsp;
                        <input type="text" oninput="if(!/^[0-9]+.?[0-9]*$/.test(this.value)){this.value='';}"/>&nbsp;<span>元/件</span>
                    </div>
                </div>
                <div class="dlg-repeatOrder-group">
                    <label>给下级利润</label>
                    <div class="new_price">
                        <span class="dlg-red-color">20</span>元/小时/人
                    </div>
                </div>
            </div>
            <div class="text-center add-padding-15">
                <button type="button" class="btn btn-warning" onclick="repeatOrderModal(1)">确认转单</button>&nbsp;&nbsp;
                <button type="button" class="btn btn-default" onclick="repeatOrderModal(2)">取消</button>
            </div>
        </div>
    </div>
</div>
<script src="js/pagination/paging.js"></script>
<script>

    var custom_userid=sessionStorage.getItem("jobId");
    $(function () {
        getInfo();
        getPage(1,10)
    })
    function todoPageSize(pageSize,total) {
        if(total>0){
            $('#pageTool').Paging({
                pageSize: pageSize,
                count: total,
                callback: function (page, pageSize, total) {
                    getPage(page-1,pageSize);
                }
            });
        }
    }
        $(".dlg-lgsc-box div span").click(function () {
        addActive(this);
    })
    var arrProgress = [12, 46, 89, 30];
    for (var i = 0; i < arrProgress.length; i++) {
        $(".dlg-lgsc-list-right label").eq(i).progressbar({
            value: arrProgress[i]
        });
    }
    function zhuandan() {
        $("#repeatOrder_modal").show();
    }
    function repeatOrderModal(obj){
        $("#repeatOrder_modal").hide();
    }
    function getInfo(){
        var dataJson={
            "access_token":access_token,
            "clienttype":2
        }
        $.ajax({
            url: url + '/ent/'+ custom_userid+'/getinfo',
            type: 'post',
            dataType: 'json',
            contentType: "application/json; charset=utf-8",
            data: JSON.stringify(dataJson),
            //timeout: '1000',
            cache: 'false',
            success: function (jsData) {
                if(jsData.status==200&&jsData.body.code=="SUCCESS"){
                    var html=""
                    if(jsData.body.data!=[]){
                        var data=jsData.body.data;
                        html+="   <img src=\"";
                        if(data.logo=="None"){
                            html+="images/mifeng.png";
                        }else{
                            html+=data.logo;
                        }
                        html+="\" alt=\"\">\n" +
                            "    <ul>\n" +
                            "        <li>"+data.name+" <span> <i class=\"ren\"></i> ";
                        if(data.audit==0){
                            html+="认证中";
                        }else if(data.audit==1){
                            html+="认证成功";
                        }else if(data.audit==2){
                            html+="认证失败";
                        }
                        html+="</span></li>\n" +
                            "        <li>私营企业</li>\n" +
                            "        <li>"+data.name+"</li>\n" +
                            "        <li>注册时间：+data.ctime+</li>\n" +
                            "    </ul>";

                    }else{
                        html += "<li>";
                        html += " <div class=\"dlg-row add-padding-15\">";
                        html += "     <h3 class='font-16 text-center' style='color: red;'>";
                        html += "         <img class='dlg-no-list-img' src='./images/no-list.png'/>";
                        html += "     </h3>";
                        html += " </div>";
                        html += "</li>";
                    }
                    $("#info").html("").append(html);
                }
            }
        })
    }
    function  getPage(page,size) {
        var dataJson = {
            "pagenum": page-1,
            "pagesize": size,
            "clienttype":"2",
            "group_code":""
             ,
            // "access_token":access_token,
             "is_allow_agent":1
        };
        $.ajax({
            url: url + '/job/userJobList/'+ custom_userid,
            type: 'post',
            dataType: 'json',
            contentType: "application/json; charset=utf-8",
            data: JSON.stringify(dataJson),
            //timeout: '1000',
            cache: 'false',
            success: function (jsData) {
                console.log("全部零工",jsData)
                if (jsData.status == 200 && jsData.body.code == 'SUCCESS') {
                    var html='  <p>正在使用代理服务的零工</p>';
                    if(jsData.body.data.total>0){
                        for(var i=0;i<jsData.body.code.data.list.length;i++)
                            var vo =jsData.body.code.data.list[i];
                        html+='<div class="odd_list_line">\n' +
                            '        <ul>\n' +
                            '            <li><b class="odd_name">'+vo.task_title+'</b> <img src="images/icon_5.png" alt=""> <img src="images/icon_8.png" alt="">\n' +
                            '                <span>'+vo.post_type_name+'</span>' +
                            ' <span>'+vo.cost_accounting_type_name+'</span></li>\n' ;
                        if(vo.cost_accounting_type==1) {
                            html+="<li><b class=\"redColor\">" + vo.price_wage + "</b>&nbsp;" + vo.job_meter_unit_wage_name;
                        }else if(vo.cost_accounting_type==2){
                            html+="<li><b class=\"redColor\">" + vo.price_commission + "</span>&nbsp;" + vo.job_meter_unit_commission_name;
                        }else if(vo.cost_accounting_type==3){
                            html+="<li><b class=\"redColor\">" + vo.price_wage + "</span>&nbsp;" + vo.job_meter_unit_wage_name
                                +"<li><b class=\"redColor\">" + vo.price_commission + "</span>&nbsp;" + vo.job_meter_unit_commission_name;
                        }
                        html+  '需'+vo.recruit_number+'人 工作时间：'+vo.start_date.replace(/-/g, ".").substr(5)+"-"+vo.end_date.replace(/-/g, ".").substr(5);
                        for(var i=0;i<vo.job_time.length;i++){
                            html+=" "+vo.job_time[i].start_time.substr(0,5)+"-"+vo.job_time[i].end_time.substr(0,5);
                        }
                        html+='</li>\n' +
                            '            <li>'+vo.work_address+'</li>\n' +
                            '        </ul>\n' +
                            '        <div class="dlg-row-3 text-center">\n' +
                            '            <div class="dlg-lgsc-list-right">\n' +
                            '                进度&nbsp;\n' +
                            '                <label class="dlg-box"></label>\n' +
                            '('+ (vo.recruit_number-vo.surplus_recruit_number)+'/'+vo.recruit_number+')'+
                            '            </div>\n' +
                            '        </div>\n' +
                            '        <span class="zhuan_odd" onclick="showRepeatOrderModal(\''+vo.id+'\')">转单</span>\n' +
                            '    </div>'
                    }else {
                        html += " <div class=\"dlg-row add-padding-15\">";
                        html += "     <h3 class='font-16 text-center' style='color: red;'>";
                        html += "         <img class='dlg-no-list-img' src='./images/no-list.png'/>";
                        html += "     </h3>";
                        html += " </div>";
                    }

                    $("#odd_list").html("").append(html);
                    todoPageSize(size,jsData.body.data.total);
                }
            }
        })
    }
    
</script>